package com.sad.jetpack.v1.datamodel.demo;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

import com.sad.jetpack.v1.datamodel.api.IDataModelResponse;
import com.sad.jetpack.v1.datamodel.api.utils.LogcatUtils;

import java.util.Observable;
import java.util.Observer;

public class Fragment1 extends Fragment {
    private TextView tv_console;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.fragment_1,container,false);
        return view;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initView();
        observeData();
    }

    private void initView(){
        tv_console=getView().findViewById(R.id.console_f1);
        tv_console.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Bundle b=getArguments();
                if (b!=null){
                    int s=b.getInt("index");
                    if (b!=null){
                        initSocketCLient();
                    }
                }
            }
        });
    }

    private void observeData(){

    }

    private void initSocketCLient(){

    }

    @Override
    public void onDestroy() {
        super.onDestroy();

    }
}
